﻿using System;

namespace BZLib
{
    namespace Global
    {
        public class Point: IPackable, IUnpackable
        {
            public double X;
            public double Y;
            public double Z;

            public Point(double x, double y, double z)
            {
                X = x;
                Y = y;
                Z = z;
            }
            public Point()
            {
                X = 0;
                Y = 0;
                Z = 0;
            }

            BinaryString IPackable.Pack()
            {
                BinaryString str = new BinaryString();
                str.PackFloat((float)X);
                str.PackFloat((float)Y);
                str.PackFloat((float)Z);
                return str;
            }

            BinaryString IUnpackable.Unpack(BinaryString str)
            {
                X = str.UnpackFloat();
                Y = str.UnpackFloat();
                Z = str.UnpackFloat();
                return str;
            }
        }

        public enum TeamName
        {
            Automatic = -2,
            NoTeam = -1,
            Rogue = 0,
            Red = 1,
            Green = 2,
            Blue = 3,
            Purple = 4,
            Observer = 5,
            Rabbit = 6
        }
        public enum PlayerType
        {
            Tank = 0,
            Robot = 1
        }
        public enum DeathReason
        {
            Killed = 0,
            Shot = 1,
            RunOver = 2,
            Captured = 3,
            Genocide = 4,
            SelfDestruct = 5,
            Water = 6,
            Last = 7, // Not to be used, just signals the last one
            PhysicsDriver = 0x7064
        }
        public enum GameStyle
        {
            Plain = 0,
            CaptureTheFlag = 1 << 0,
            SuperFlags = 1 << 1, // Flags allowed
            // Old style not used any more (1 << 2)
            Jumping  = 1 << 3, // Jumping allowed
            Inertia  = 1 << 4, // Momentum for all
            Ricochet = 1 << 5, // Shots ricochet
            Shakable = 1 << 6, // Bad flags can be dropped
            Antidote = 1 << 7, // Antidote flags
            Handicap = 1 << 8, // Handicap allowed
            Rabbit   = 1 << 9, // Rabbit game
        }
        public enum PlayerState
        {
            Dead = 0,
            Alive = 1 << 0,
            Paused = 1 << 1,
            Exploding = 1 << 2,
            Teleporting = 1 << 3,
            FlagActive = 1 << 4,
            CrossingWall = 1 << 5,
            Falling = 1 << 6,
            OnDriver = 1 << 7,
            UserInputs = 1 << 8,
            JumpJets = 1 << 9,
            PlaySound = 1 << 10
        }
        public enum StatusSound
        {
            None = 0,
            Jump = (1 << 0),
            Wings = (1 << 1),
            Bounce = (1 << 2)
        }

        public static class Extentions
        {
        }
    }
}
